import entity.Node;

import java.util.ArrayList;
import java.util.List;

public class ListToTree {
    public static void main(String[] args) {
        Node node0 = new Node(1,"package",-1);
        Node node1 = new Node(2,"model",1);
        Node node2 = new Node(3,"model",1);
        Node node3 = new Node(4,"file1",2);
        Node node4 = new Node(5,"file2",2);
        List<Node> list= new ArrayList<>();
        list.add(node0);
        list.add(node1);
        list.add(node2);
        list.add(node3);
        list.add(node4);
        List<Node> nodesTree = TreeUtils.buildTree(list,-1);
        System.out.println(nodesTree.toString());
    }

}
